<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2022/7/18
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <a href="./selbuiding">添加</a>
    <table border="1">
        <tr>
            <td>设备编号</td>
            <td>负责人</td>
            <td>供货商</td>
            <td>品牌</td>
            <td>楼宇</td>
            <td>状态</td>
            <td>日期</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="list">
            <tr>
                <td>${list.id}</td>
                <td>${list.principal}</td>
                <td>${list.supplier}</td>
                <td>${list.brand}</td>
                <td>${list.buiding.name}</td>
                <td>${list.status==1?"启用":"停用"}</td>
                <%--调用日期格式化标签fmt:formatDate标签
                    value=你的日期值
                    pattern=你的日期格式
                --%>
                <td><fmt:formatDate value="${list.addTime}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                <td><a href="./deleteAccess?id=${list.id}">删除</a>/
                    <a href="./updateAccess?status=${list.status==0?"1":"0"}&id=${list.id}">${list.status==1?"停用":"启用"}</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    共${pageInfo.total} 当前页${pageInfo.pageNum}
    <a href="./listAccess?pageNum=1">首页</a>
    <a ${pageInfo.hasPreviousPage?"":"hidden"} href="./listAccess?pageNum=${pageInfo.pageNum-1}">上一页</a>
    <a ${pageInfo.hasNextPage?"":"hidden"}  href="./listAccess?pageNum=${pageInfo.pageNum+1}">下一页</a>
    <a href="./listAccess?pageNum=${pageInfo.pages}">尾页</a>
</body>
</html>
